export const checkC = {
  test: /^#[0-9a-fA-F]{6}$/,
  message: '输入颜色格式不正确,使用HEX格式，如#FFFFFF'
}

export const checkColor = (rule, value, callback) => {
  if (value) {
    if (checkC.test.test(value)) {
      callback()
    } else {
      callback(new Error(checkC.message))
    }
  } else {
    callback()
  }
}
